﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using OddUserManager.Service.IServices;
using OddUserManager.Web.Models;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace OddUserManager.Web.Controllers
{
    public class SystemConstantController : Controller
    {
        private ISystemConstantService _service;

        public SystemConstantController(ISystemConstantService service) {
            _service = service;
        }


        public IActionResult GetOddMoneyBoundary() {
            JsonData d = new JsonData();
            d.Data = _service.GetAllList().FirstOrDefault(p=>p.ConstantKey== "OddMoneyBoundary").ConstantValue;
            return Json(d);
        }

        // GET: /<controller>/
        public IActionResult Index()
        {
            return View();
        }
    }
}
